<script setup lang="ts">
import { computed, ref } from 'vue'
import { taskActiveList, isActiveList, isUrgentList } from '../../utils/task'

const props = defineProps({
  item: {
    type: Object,
    required: true
  }
})
const taskType = computed(() => {
  let item = taskActiveList.find((e: any) => {
    return e.value == props.item.taskActive
  })
  return item
})

const isActive = computed(() => {
  let item = isActiveList.find((e: any) => {
    return e.value == props.item.isActive
  })
  return item
})
const isUrgent = computed(() => {
  let item = isUrgentList.find((e: any) => {
    return e.value == props.item.isUrgent
  })
  return item
})
</script>

<template>
  <van-step>
    <div class="title">
      <div class="tagBox">
        <van-tag class="tag" size="medium" :type="taskType?.type" round>{{
          taskType?.label
        }}</van-tag>
        <van-tag class="tag" size="medium" :type="isActive?.type" round>{{
          isActive?.label
        }}</van-tag>
        <van-tag class="tag" size="medium" :type="isUrgent?.type" round>{{
          isUrgent?.label
        }}</van-tag>
      </div>
      <div class="activateTime">
        {{ item.activateTime }}
      </div>
    </div>

    <div class="taskRemark">
      {{ item.taskRemark }}
    </div>
  </van-step>
</template>

<style lang="less" scoped>
.title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tagBox {
  padding: 4px 0;
}
.tag {
  margin-right: 8px;
}
.taskRemark {
  font-size: 16px;
  padding: 12px 0;
}
.activateTime {
  font-size: 12px;
  color: var(--van-gray-6);
}
</style>
